# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessBusinessInformation.V1.Model.Attribute do
  @moduledoc """
  A location attribute. Attributes provide additional information about a location. The attributes that can be set on a location may vary based on the properties of that location (for example, category). Available attributes are determined by Google and may be added and removed without API changes.

  ## Attributes

  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. The resource name for this attribute.
  *   `repeatedEnumValue` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.RepeatedEnumAttributeValue.t`, *default:* `nil`) - When the attribute value type is REPEATED_ENUM, this contains the attribute value, and the other values fields must be empty.
  *   `uriValues` (*type:* `list(GoogleApi.MyBusinessBusinessInformation.V1.Model.UriAttributeValue.t)`, *default:* `nil`) - When the attribute value type is URL, this field contains the value(s) for this attribute, and the other values fields must be empty.
  *   `valueType` (*type:* `String.t`, *default:* `nil`) - Output only. The type of value that this attribute contains. This should be used to determine how to interpret the value.
  *   `values` (*type:* `list(any())`, *default:* `nil`) - The values for this attribute. The type of the values supplied must match that expected for that attribute. This is a repeated field where multiple attribute values may be provided. Attribute types only support one value.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :name => String.t() | nil,
          :repeatedEnumValue =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.RepeatedEnumAttributeValue.t() | nil,
          :uriValues =>
            list(GoogleApi.MyBusinessBusinessInformation.V1.Model.UriAttributeValue.t()) | nil,
          :valueType => String.t() | nil,
          :values => list(any()) | nil
        }

  field(:name)

  field(:repeatedEnumValue,
    as: GoogleApi.MyBusinessBusinessInformation.V1.Model.RepeatedEnumAttributeValue
  )

  field(:uriValues,
    as: GoogleApi.MyBusinessBusinessInformation.V1.Model.UriAttributeValue,
    type: :list
  )

  field(:valueType)
  field(:values, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.Attribute do
  def decode(value, options) do
    GoogleApi.MyBusinessBusinessInformation.V1.Model.Attribute.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.Attribute do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
